Simple Telegram bot to transcribe voice messages sent to it via Azure speech-to-text. https://github.com/Ceralor/telegram-azure-transcribe-bot
Find a file
2023-11-30 22:23:10 -06:00
.vscode Debug config 2023-11-30 09:39:50 -06:00
.gitignore Added config files to ignore 2023-11-30 09:37:15 -06:00
bot.py Clean logging to permit config 2023-11-30 21:02:45 -06:00
Dockerfile Added label detail for Dockerfile for github packages 2023-11-30 21:56:28 -06:00
LICENSE Initial commit 2023-11-30 15:29:25 +00:00
README.md Add detach 2023-11-30 22:23:10 -06:00

telegram-azure-transcribe-bot

Simple Telegram bot to transcribe voice messages sent to it via Azure speech-to-text.

Configure

You'll need a free (or paid) Azure account with a Speech Services resource. You can visit the Azure Speech Services page to get started. Make sure to select Free Plan when creating the resource and NOT the pay-as-you-go option.

Configure .env file with the following:

  • TELEGRAM_BOT_TOKEN: Token provided by @BotFather
  • TELEGRAM_BOT_ALLOWED_CHAT_IDS: optional comma-separated list of chat IDs that may use this bot
  • SPEECH_KEY: speech key from Azure speech service
  • SPEECH_REGION: region from Azure speech servce
  • LOG_LEVEL: optional, use strings from Python 'logging' such as INFO, WARN, DEBUG, ERROR

Run in Docker

You have two options for running in Docker.

Use pre-built package

docker pull ghcr.io/ceralor/telegram-azure-transcribe-bot:latest

Build locally

Clone the repository, then use `docker build . -t

Running

Either create a .env file with the required variables (below) or supply via -e LOG_LEVEL=WARN in the command line.

docker run --restart unless-stopped --env-file .env --detach ghcr.io/ceralor/telegram-azure-transcribe-bot:latest

Running bare or building

Requires libraries:

  • python-telegram-bot[job-queue]
  • python-dotenv
  • azure-cognitiveservices-speech
  • pydub

Requires installed:

  • dotnet
  • ffmpeg

Then python bot.py